package com.robot.controller;

import com.robot.common.result.Response;
import com.robot.dao.dto.IntegralDTO;
import com.robot.dao.dto.IntegralOperateDTO;
import com.robot.dao.dto.UserDTO;
import com.robot.dao.vo.CompanyVO;
import com.robot.dao.vo.IntegralVO;
import com.robot.service.IntegralService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/integral")
@Slf4j
@Api(tags = "积分操作")
public class IntegralController {

    @Autowired
    private IntegralService integralService;



    @PostMapping("/queryIntegral")
    @ApiOperation("查询积分余额")
    public Response<IntegralVO> queryIntegral(@RequestBody IntegralDTO integralDTO) {
        IntegralVO integralVO=integralService.queryIntegral(integralDTO);
        return Response.success(integralVO);
    }


    @PostMapping("/operateIntegral")
    @ApiOperation("操作积分")
    public Response<IntegralVO> operateIntegral(@RequestBody IntegralOperateDTO integralOperateDTO) {
       integralService.operateIntegral(integralOperateDTO);
        return Response.success();
    }

}
